package com.llh.cheap.mappers;

import com.llh.cheap.models.CheapUser;
import org.springframework.jdbc.core.RowMapper;
import top.moirae.security.mappers.UserMapper;

/**
 * @author lilinhan
 **/
public class CheapUserMapper {
    public static final RowMapper<CheapUser> DETAIL = (rs, index) -> {
        CheapUser entity = new CheapUser();
        entity.setId(rs.getString("id"));
        entity.setUser(UserMapper.dynamicColumnsWithMobileAndPortrait("u1_id", "u1_name", "u1_mobile", "u1_portrait").mapRow(rs, index));
        entity.setBossId(rs.getString("boss_id"));
        entity.setWechatName(rs.getString("wechat_name"));
        entity.setCustomerNumber(rs.getString("customer_number"));
        entity.setQxtCode(rs.getString("qxt_code"));
        entity.setQxtShare(rs.getString("qxt_share"));
        entity.setQxtAccount(rs.getString("qxt_account"));
        entity.setQxtPassword(rs.getString("qxt_password"));
        entity.setEmployeeNumber(rs.getString("employee_number"));
        entity.setRecommendName(rs.getString("recommend_name"));
        return entity;
    };
}

